package Day36.test2;

public class StackTest {
    public static void main(String[] args) {
        //创建栈对象
        Stack stack = new Stack(10);
//        stack.pop();
        //入栈
        stack.push(10);
        stack.push(20);
        System.out.println("栈中元素数量:"+stack.size());
        //出栈
        int num = stack.pop();
        System.out.println(num);
        //读取栈顶元素
        int peak = stack.peak();
        System.out.println(peak);
    }
}
